

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<c:set var="path" value="<%=basePath %>"/>
<script type="text/javascript">
var ctx =  "${path}";
</script>